home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
-
- Four very simple steps to burn a Data CD/DVD
-
- /******************************************************************************/
-
- #include <stdio.h>
- #include <conio.h>
- #include "..\..\include\MCDBCls.h"
-
- /******************************************************************************/
-
- CMCDBurner mcdb;
-
- int main()
- {
- mcdb.SelectDevice(0); // Step 1: Selecting First device
- mcdb.SetVolumeID("binarymagics.com"); // Set Volume Label (Not required)
-
- //mcdb.InsertFile("\\", "c:\\autoexec.bat"); // Step 2: File to Burn
- mcdb.InsertDir("\\", "c:\\Program Files\\Windows Media Player\\", "*.*", TRUE, FALSE); // Step 2: Dir to Burn
- mcdb.Prepare(); // Step 3: Prepare the data for Burning
- if (mcdb.Burn(&CMCDBurner::WriteDone, NULL) == TRUE) // Step 4: Now Burn the File/Dir
- // if (mcdb.BuildISOImage("c:\\test.iso",&CMCDBurner::WriteDone, NULL) == TRUE) // Step 4: If want to Build ISO File
- //if (mcdb.BurnISOImage("c:\\abc.iso", &CMCDBurner::WriteDone, NULL) == TRUE) // Step 4: if Burning ISO Image
- {
- printf("Please wait while burning Disc \nDon't press any key till the Write Done message comes ...");
- printf("\nSo Please wait ...\n");
- }
- else
- printf("Burn/Build start failed (ERR: %d), Press any key to exit", mcdb.GetErrorNumber());
-
- return getch();
- }
-
- /******************************************************************************/
- void _stdcall CMCDBurner::EraseDone(BOOL FAILED, void *ptr)
- {
- printf("\nErase is done ... (%s)", FAILED ? "FAILED": "SUCCESS");
- }
-
- /******************************************************************************/
- void __stdcall CMCDBurner::WriteDone(BOOL FAILED, void *arg)
- {
- printf("\n\nWrite done ... (%s)", FAILED ? "FAILED": "SUCCESS");
-
- }
-